def count_characters(s):
    """
    统计字符串中字母、数字、空格和其他字符的数量。
    
    参数:
    s (str): 要统计的字符串

    返回:
    dict: 包含每种字符类型数量的字典
    """
    counts = {"letters": 0, "digits": 0, "spaces": 0, "others": 0}
    
    for char in s:
        if char.isalpha():
            counts["letters"] += 1
        elif char.isdigit():
            counts["digits"] += 1
        elif char.isspace():
            counts["spaces"] += 1
        else:
            counts["others"] += 1
    
    return counts

# 测试示例
result = count_characters("Hello World! 1234.")
print(result)  # 输出: {'letters': 10, 'digits': 4, 'spaces': 2, 'others': 2}
